const { mySequelize } = require('./config');
const { verifyToken } = require("./util/token");

const test = async () => {

  // * 测试是否链接成功

  await mySequelize.authenticate()
    .then(() => {
      console.log('成功连接到数据库.');
    })
    .catch(err => {
      console.error('无法连接到数据库:', err);
    });
  // await mySequelize.authenticate();
  console.log('当前环境NODE_ENV为:', process.env.NODE_ENV);
  verifyToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbl9pZCI6MSwiaWF0IjoxNzI0ODI3ODg5LCJleHAiOjE3MjU0MzI2ODl9.ERIalNha_R6Ozjj4I_hYupchjFJ2M4wSt49U2aKZz0E")
    .then((decode) => {
      console.log(decode);
    })
  mySequelize.close();
};


test();